package com.itheima.reggie.common;

public class BaseContext {
    private BaseContext( ){
    }
    //定义一个本地线程
    private static final ThreadLocal <Long> THREAD_LOCAL=new ThreadLocal<>();
    //提供静态方法,设置数据
    public static void setCurrentId(Long employeeId){
        THREAD_LOCAL.set(employeeId);
    }
    //提供静态方法,获取数据
    public static Long getCurrentId(){
        return THREAD_LOCAL.get();
    }
    //提供静态方法,移除数据
    public static void removeCurrentId(){
        THREAD_LOCAL.remove();
    }
}


